<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <style type="text/css" media="all">

        .ui-panelgrid td{
            border: none !important;
        }

        .ui-widget-content .ui-panelgrid-even{
            border: none !important;
        }

        .ui-widget-content .ui-panelgrid-odd{
            border: none !important;
        }
        .ui-widget-content .ui-widget-content{
            border: none !important;
        }

    </style>

    <ui:composition>

        <p:dialog id="UsuarioCreateDlg" widgetVar="UsuarioCreateDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.CreateUsuarioTitle}">
            <h:form id="UsuarioCreateForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{usuarioController.selected != null}">
                        <p:row>
                            <p:column>
                                <p:outputLabel value="#{bundle.CreateUsuarioLabel_nuCpf}" for="nuCpf" />
                            </p:column>
                            <p:column>
                                <p:inputMask mask="999.999.999-99" id="nuCpf" maxlength="14" converter="cpfConverter" value="#{usuarioController.selected.nuCpf}" title="#{bundle.CreateUsuarioTitle_nuCpf}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_nuCpf}"/>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:outputLabel value="#{bundle.CreateUsuarioLabel_nmUsuario}" for="nmUsuario" />
                            </p:column>
                            <p:column>
                                <p:inputText id="nmUsuario" value="#{usuarioController.selected.nmUsuario}" title="#{bundle.CreateUsuarioTitle_nmUsuario}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_nmUsuario}"/>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:outputLabel value="#{bundle.CreateUsuarioLabel_nuTelefone}" for="nuTelefone" />
                            </p:column>
                            <p:column>
                                <p:inputText id="nuTelefone" value="#{usuarioController.selected.nuTelefone}" title="#{bundle.CreateUsuarioTitle_nuTelefone}" />
                            </p:column>
                        </p:row>

                        <p:row>
                            <p:column>
                                <p:outputLabel value="#{bundle.CreateUsuarioLabel_edEmail}" for="edEmail" />
                            </p:column>
                            <p:column>
                                <p:inputText id="edEmail" value="#{usuarioController.selected.edEmail}" title="#{bundle.CreateUsuarioTitle_edEmail}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_edEmail}"/>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:outputLabel value="#{bundle.CreateUsuarioLabel_senha}" for="senha" />
                            </p:column>
                            <p:column>
                                <p:password id="senha" match="ConfirmaSenha" value="#{usuarioController.selected.senha}" title="#{bundle.CreateUsuarioTitle_senha}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_senha}"/>
                            </p:column>
                        </p:row>
                        <p:row>
                            <p:column>
                                <p:outputLabel value="Confirma Senha" for="ConfirmaSenha" />
                            </p:column>
                            <p:column>
                                <p:password id="ConfirmaSenha" value="#{usuarioController.confirmaSenha}" title="#{bundle.CreateUsuarioTitle_ConfirmaSenha}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_ConfirmaSenha}"/>
                            </p:column>
                        </p:row>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{usuarioController.create}" value="#{bundle.Save}" update="display,:UsuarioListForm:datalist,:growl" oncomplete="handleSubmit(args,'UsuarioCreateDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="UsuarioCreateDialog.hide()" immediate="true"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
